package com.rd.student.jike.class2.xuezhixin.day0731;

import com.rd.teacher.jichao.day02.InnerInterface;

import java.util.ArrayList;
import java.util.Iterator;

public class Work04 {

    // 随机一个移除一个

    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0;i<50;i++){
            list.add(i);
        }

        for (int i = 0;i<20;i++){
            int subscript = (int) (Math.random() * list.size());
            System.out.println((i+1) + "\t" + list.remove(subscript));
        }
    }
}
